package cn.ztydata.teachingsystem.heaven.dao;

import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.stereotype.Repository;

/**
 * 历史学生选课表
 * Created by wyh on 2015/4/1.
 */
@Repository
public class HistoryScDao extends BaseDao {

    /**
     * 批量保存学生选课
     * @return int
     *
     * @author wyh
     * @since 2015-03-26
     */
    public int saveAll(){
        String sql = "INSERT INTO t_history_sc (SELECT NULL, sCourseCode, sStudentNum FROM t_student_course)";

        log.debug("return 归档学生选课数据的结果");
        return namedParameterJdbcTemplate.update(sql, new MapSqlParameterSource());
    }
}
